package com.lry.util.common.entity;

import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * 返回结果对象
 *
 * @author 李瑞益
 * @date 2019/9/25
 */
@Data
@NoArgsConstructor
public class ResultData<T> implements Serializable {

    private static final long serialVersionUID = -4304353934293881342L;
    /**数据对象*/
    private T data;

    /**处理结果*/
    private boolean result;

    /**分页对象*/
    private ResPageInfo pageInfo;

    /**错误信息对象*/
    private SysError error;

    public ResultData(T data){
        this.result = true;
        this.data = data;
    }


    public ResultData(T data, ResPageInfo pageInfo) {
        this(data);
        this.pageInfo = pageInfo;
    }

    public ResultData(SysError error) {
        this.error= error;
    }
}
